//       https://www.nowcoder.com/questionTerminal/11cc498832db489786f8a03c3b67d02c






#include <iostream>
#include <vector>
using namespace std;

vector<int> a;
vector<vector<int>> ans;

void dfs(int n, int m, int start)
{
    if (m == 0)
    {
        ans.push_back(a);
        return;
    }

    for (int i = start; i <= n; ++i)
    {
        if (i > m) break;

        a.push_back(i);
        dfs(n, m - i, i + 1);
        a.pop_back();
    }
}

int main()
{
    int n, m;
    cin >> n >> m;

    dfs(n, m, 1);

    for (const auto& x : ans)
    {
        for (int num : x)
            cout << num << " ";
        cout << endl;
    }

    return 0;
}
